package Collection_Stu;

import java.util.*;

public class Collection_Stu {

	public static void main(String[] args) {

		Collection<Stu> Stu = new ArrayList<Stu>();

		Stu s1 = new Stu("121", 1);
		Stu s2 = new Stu("122", 2);
		Stu s3 = new Stu("123", 3);

		Stu.add(s1);
		Stu.add(s2);
		Stu.add(s3);

		Iterator<Stu> iterator = Stu.iterator();

		while (iterator.hasNext()) {
			Stu s = iterator.next();
			System.out.println(s.getName()+","+s.getAge());
		}

	}
}
